/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.yandex.prodcons.threads;

/**
 *
 * @author Neophron
 */
public class Producer implements Runnable {

    private final RingBuffer buffer;
    private final int toWrite;

    Producer(RingBuffer buffer, int toWrite) {
        this.buffer = buffer;
        this.toWrite = toWrite;
    }

    @Override
    public void run() {
        buffer.put(toWrite);
    }

}
